//---------------------------------------------------------------------------
// MyResultSet Class
// Author : Alex Woo-Hyun Kim at www.webrobot.org
// Email : woorung@webrobot.org,webrobot@hotmail.com,woorung@empal.com
// Date : Apr. 18, 2002
//
// This class manages the result set obtained by CMyMan class.
//---------------------------------------------------------------------------
#ifndef CMyResultSetH
#define CMyResultSetH
//---------------------------------------------------------------------------
#include <mysql.h>
//---------------------------------------------------------------------------
class CMyResultSet {
private :
	MYSQL_RES *m_pMyResultSet;
	MYSQL_ROW m_pMyRow; // this is pointer type, so you shouldn't type the '*'
	MYSQL_FIELD *m_pMyFields;  // this is pointer of pointer of MYSQL_FIELD type
	unsigned int m_uMyColumnCount;	
	unsigned long m_ulMyRowCount;
	unsigned int m_uMyCurColumnCount;
	unsigned long m_ulMyCurRowCount;
	unsigned int m_uMyMetaNameCount;
public :
	CMyResultSet(unsigned long ulAffectedRows);
	CMyResultSet(MYSQL_RES *pMyResultSet);
	~CMyResultSet();
	bool HasMoreRowsFromMyResultSet();
	bool HasMoreColumnFromCurRows();
	bool HasMoreMetaNameFromMyResultSet();
	unsigned long GetAffectedRows();
	const char *GetString();
	const char *GetString(int iColumnCount);
	const char *GetString(char *pszColumnName);
	const char *GetMetaNameString();
	const char *GetMetaNameString(int iColumnCount);

#ifdef DEBUG
        void Debug(char *str);
        void Debugln(char *str);
        void Debug(int i);
        void Debugln(int i);
#endif
};
//---------------------------------------------------------------------------
#endif
